<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
  <title> 发布需求 </title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
 <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=10" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
    
    <link href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="css/foot.css" rel="stylesheet">
    <link href="css/release.css" rel="stylesheet">
    <!--  <link href="css/APPdoalown.css" rel="stylesheet"> -->
    <script type="text/javascript" src="js/jquery-2.0.3.min.js"></script>
    <script src="bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript"></script>
       <script src="jsp/layer/layer.js" type="text/javascript"></script>
       
       <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <style type="text/css">
        /*.all_foot{height:70px;line-height: 0px;}*/
        /*.all_foot_nav_navs{padding:12px 15px;}*/
		
		.fgx{

    /*width: 100px;*/
    /*border:0.2px solid red;*/
    border-style:outset;width:110%;
    margin-left: 0px;
    margin-top:2px;
}
    </style>
    <script type="text/javascript">

     function a(value){
    
    	 if(value==1){
    		 $(".div3").css("display","block");
    	   	  $(".div1").css("display","none");
    	   	  $(".div2").css("display","none");  
    	 }
    	 if(value==2){
    		 $(".div3").css("display","none");
    	   	  $(".div1").css("display","block");
    	   	  $(".div2").css("display","none"); 
    	 }
    	 if(value==3){
    		 $(".div3").css("display","none");
    	   	  $(".div1").css("display","none");
    	   	  $(".div2").css("display","block");
    	 }
     }

</script>
<%-- <script type="text/javascript">
$(function(){
	var taskTitle=$("#taskTitle").val();
	var taskTotalNumber=$("#taskTotalNumber").val();
	var taskBonus=$("#taskBonus").val();
	var taskTitle1=$("#taskTitle1").val();
	var taskTotalNumber1=$("#taskTotalNumber1").val();
	var taskBonus1=$("#taskBonus1").val();
	var taskTitle2=$("#taskTitle2").val();
	var taskBonus2=$("#taskBonus2").val();
	var taskTotalNumber2=$("#taskTotalNumber2").val();
	var taskBriefing=$("#taskBriefing").val();
	var appAndroidUrl=$("#appAndroidUrl").val();
	var appIOSUrl=$("#appIOSUrl").val();
	$("#taskTitle").blur(
	function(){
	if(taskTitle==null){
		layer.msg("标题不能为空！", {
		    time: 10000,       
		  });
		return null;
	}
			});
	
	$("#taskTotalNumber").blur(function(){
		if(taskTotalNumber==null){
			layer.msg("总数不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
	});
	$("#taskTitle1").blur(function(){
		if(taskTitle1==null){
			layer.msg("总数不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
	});
	$("#taskTotalNumber1").blur(function(){
		if(taskTotalNumber1==null){
			layer.msg("金额不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
	
	});
	$("#taskBonus").blur(function (){
		if(taskBonus==null){
			layer.msg("金额不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
	});
	
	$("#taskBonus1").blur(function (){
		if(taskBonus1==null){
			layer.msg("金额不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
		
	});
	
	$("#taskTitle2").blur(function(){
		if(taskTitle2==null){
			layer.msg("总数不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
	});
	$("#taskTotalNumber2").blur(function(){
		if(taskTotalNumber2==null){
			layer.msg("金额不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
	
	});
	$("#taskBonus2").blur(function (){
		if(taskBonus2==null){
			layer.msg("金额不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
	});
    $("#taskBriefing").blur(function (){
    	if(taskBriefing==null){
			layer.msg("简介不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
    
    });
    $("#appAndroidUrl").blur(function (){
    	if(appAndroidUrl==null){
			layer.msg("简介不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
    
    	
    });
    $("#appAndroidUrl").blur(function (){
    	if(appAndroidUrl==null){
			layer.msg("简介不能为空！", {
			    time: 10000,       
			  });
			return null;
		}	
    
    	
    });
    
</script> --%>
</head>
<body>

    <!--头部-->
   <!--  <header class="box-header">
        <div class="box-header-div1">
            <div class="box-header-div1_div1"><img src="img/a-1right.png"></div>
            <div class="box-header-div1-div2" style="margin-left:10px;">
                <a href="#"> 返回 </a>
            </div>
        </div>
        <div class="box-header-div2"> 发布需求 </div>
        <div class="box-header-div3"><a href="#"><img src="img/threeDian.png" ></a></div>
    </header> -->

    <!--====================== 内容 ======================-->
    <form  action="TaskAction_queryfaTask" method="post" class="form" enctype="multipart/form-data">
    <input type="hidden" name="user.id" value="${user.id}">
   <div class="container-fluid">
    <div class="row">
        <div class="col-xs-12" >
            <div class="bs-example bs-example-form content" role="form">
                <div class="one">
                        <div class="one-one mg">
                            <label> 需求类型 </label>
                            <select name="task.taskType" onchange="a(value)">
                                <option value="1" id="a1" > 关注公众号 </option>
                                <option value="2" id="a2" >广告宣传</option>
                                 <option value="3" id="a3">APP下载</option>
                            </select>
                        </div>
                        
                        <div class="div1"style="display: none">
                        <hr class="fgx">
                        <div class="one-two mg">
                            <label> 广告标题 </label>
                            <input type="text" name="taskTitle" placeholder="要求字15数" maxlength="15" id="taskTitle">
                        </div>
                        
                        </div>
                        <div class="div2" style="display: none">
                          <hr class="fgx" >
                    <div class="one-two mg">
                        <label> APP名称 </label>
                        <input type="text" name="taskTitle1" id="taskTitle1"  placeholder="要求字25数" >
                    </div>                  
                        </div>
                       
                        <div class="div3">
                          <hr class="fgx" >
                    <div class="one-two mg">
                        <label> 公众号名称 </label>
                        <input type="text" name="taskTitle2" id="taskTitle2" placeholder="要求字25数" >
                    </div>       
                        </div>
                        <hr class="fgx" >
                        <div class="one-three mg">
                            <label> 需求总数  </label>
                            <input type="text" name="task.taskTotalNumber" id="taskTotalNumber" placeholder="要求字5-6数" >
                        </div>
                        <hr class="fgx" >
                        <div class="one-three mg">
                            <label> 需求总佣金  </label>
                            <input type="text" name="task.taskTotalBonus" placeholder="要求字5-6数" id="taskTotalBonus">
                        </div>
                         <hr class="fgx" >
                        <div class="one-three mg">
                            <label> 需求佣金  </label>
                            <input type="text" name="task.taskBonus" placeholder="要求字5-6数" id="taskBonus">
                        </div>
                    </div>
                </div>
            </div>
        </div>
         <div class="row row2">
        <div class="col-xs-12" >
            <div class="bs-example bs-example-form content" role="form" >
                <div class="two">
                    <div class="two-one mg">
                        <label>简介 </label>
                          <!-- <div  contenteditable="true">

                        </div>  -->
                     <input type="text" class="synopsis" name="task.taskBriefing" id="taskBriefing" placeholder="要求字10-30数"  maxlength="30"> 

                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row row3" id="rowx">
        <div class="col-xs-12" >
            <div class="bs-example bs-example-form content" role="form" >
                <div class="three">
                    <div class="three-one mg">
                        <label> LOGO </label> 
                         <span id="preview1" style="font-weight:580; font-size:14px; color: #BBB">图片尺寸,大小要求限制</span> 
                       	
                        <a class="a-upload">
                            <input type="file" name="fileTest" onchange="preview(this)" >选择上传图片
                        </a>
                         <script>  
       function preview(file)  {
               var prevDiv = document.getElementById('preview1');
               if (file.files && file.files[0]){
                       var reader = new FileReader();
                         reader.onload = function(evt){
                        prevDiv.innerHTML = '<img src="' + evt.target.result + '" with="35" height="35"/>';
                             }  
                       reader.readAsDataURL(file.files[0]);
                         }else{
                  prevDiv.innerHTML = '<div class="img1" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\')" ></div>';
    }
    }
 </script>	  
                        
                        
                    </div>
                 <div class="div3">
                     <hr class="fgx" style=" margin-bottom:0px;">
                     <div class="three-two mg">
                        <label> 公众号二维码 </label>
                       <span id="preview" style="font-weight:580; font-size:14px; color: #BBB">图片尺寸,大小要求限制</span> 
                      
                        <a class="a-upload">
                       
                            <input type="file" name="fileTest1" onchange="preview1(this)">选择上传图片
                        </a>
                           <script>  
       function preview1(file)  {
               var prevDiv = document.getElementById('preview');
               if (file.files && file.files[0]){
                       var reader = new FileReader();
                         reader.onload = function(evt){
                        prevDiv.innerHTML = '<img src="' + evt.target.result + '" with="35" height="35"/>';
                             }  
                       reader.readAsDataURL(file.files[0]);
                         }else{
                  prevDiv.innerHTML = '<div class="img1" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\')" ></div>';
    }
    }
 </script>	  
                    </div>
                    </div> 
                </div>
            </div>
        </div>
    </div>
    <div class="div2" style="display: none">
    <label class="a-i"> APP下载地址 </label>
    <div class="row">
        <div class="col-xs-12" >
            <div class="bs-example bs-example-form content" role="form">
                <div class="four">
                    <div class="four-one mg">
                        <label>
                            <img src="img/Android.png">
                            安卓
                        </label>
                        <input type="text" id="appAndroidUrl" name="task.appAndroidUrl" placeholder="安卓下载地址" style="width: 80%">
                    </div>
                    <hr class="fgx" >
                    <div class="four-two mg">
                        <label>
                            <img src="img/iPhone.png">
                            苹果
                        </label>
                        <input type="text" name="task.appIOSUrl" id="appIOSUrl"  placeholder="iOS下载地址" style="width: 80%">
                    </div>
                     
                </div>
            </div>
        </div>
    </div>
    </div>
        <div class="row row4">
            <div class="col-xs-12" >
                <div class="bs-example bs-example-form content" role="form" >
                   <%--  <div class="two">
                        <div class="two-one mg">
                            <label> 联系人 </label>
                            <input type="text" name="task.taskContacts"   placeholder="输入联系人" >
                        </div>
                        <hr class="fgx" >
                        <div class="two-two mg">
                            <label> 手机号 </label>
                            <input type="text" name="task.mobilePhone"  id="mobilePhone"  placeholder="手机号码" >
                        </div>
                         <input type="hidden" id="backstage" value="">
                        <hr class="fgx" >
                        <div class="two-four mg">
                            <label> 验证码 </label>
                            <input type="text"   placeholder="验证码" >
                            <span style="left:0px " id="code" onClick="getCheckCode(this)"> 获取验证码 </span>
                        </div>
                    </div> --%>
                     <div class="five">
                    <div class="five-one mg">
                        <label> 联系人 </label>
                        <input type="text" placeholder="联系名称" >
                    </div>
                    <hr class="fgx" >
                    <div class="five-two mg">
                        <label> 手机号 </label>
                        <input type="text" placeholder="手机号码" >
                    </div>
                    <hr class="fgx">
                    <div class="five-three mg">
                        <label> 验证码 </label>
                        <input type="text" placeholder="验证码" >
                        <span> 获取验证码 </span>
                    </div>
                </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12 btn">
            <input type="button" id="button" value="确认">
        </div>
    </div>
</form>

    <!--======================尾部======================-->
    <div class="container-fluid all_foot">
			<div class="row all_foot_nav">
				<div class="col-xs-3 all_foot_nav_navs">
					<a
						class="text-center help-block all_foot_nav_navs_block all_foot_nav_navs_block_true"
						href="${pageContext.request.contextPath}/UserAction_homepage">
						<div class="all_foot_nav_navs_block_icon">
							<img
								src="${pageContext.request.contextPath}/img/allIMG/index_f.png">
						</div>
						<p class="all_foot_nav_navs_block_title font13">首页</p>
					</a>
				</div>
				<div class="col-xs-3 all_foot_nav_navs">
					<a class="text-center help-block all_foot_nav_navs_block"
						href="${pageContext.request.contextPath}/TaskAction_queryOnTask">
						<div class="all_foot_nav_navs_block_icon">
							<img
								src="${pageContext.request.contextPath}/img/allIMG/renWu_f.png">
						</div>
						<p class="all_foot_nav_navs_block_title font13">任务</p>
					</a>
				</div>
				<div class="col-xs-3 all_foot_nav_navs">
					<a class="text-center help-block all_foot_nav_navs_block "
						href="${pageContext.request.contextPath}/TaskAction_queryMoneyOfUser">
						<div class="all_foot_nav_navs_block_icon">
							<img
								src="${pageContext.request.contextPath}/img/allIMG/money_f.png">
						</div>
						<p class="all_foot_nav_navs_block_title font13">钱包</p>
					</a>
				</div>
				<div class="col-xs-3 all_foot_nav_navs">
					<a class="text-center help-block all_foot_nav_navs_block "
						href="${pageContext.request.contextPath}/UserAction_myPersonal">
						<div class="all_foot_nav_navs_block_icon">
							<img
								src="${pageContext.request.contextPath}/img/allIMG/mine_f.png">
						</div>
						<p class="all_foot_nav_navs_block_title font13">我的</p>
					</a>
				</div>
			</div>
		</div>
</body>
<script type="text/javascript">
function getCheckCode(value){
	var mobile=$("#mobilePhone").val();
	if(mobile.trim().length==0){
		layer.msg("手机号码不能为空！", {
		    time: 10000,       
		  });
		return false;
	
	
	}
	$.ajax({
		type:"GET",
		url:"TaskAction_getSMSCheckCode1",//如果是主表，校验数据是否有重复，如果是子表，校验在上传之前需要主表有数据，并且不能重复。
		data:{"mobile":mobile},
		dataType:"json",
		success:function(data) {
			/* alert(data); */
			$("#backstage").val(data.code);
		}
		});
	$("#code").innerHTML("验证码已发送");
	
	
}
</script>
<script type="text/javascript">
$(function(){
	$("#button").click(function(){
		$(".form").submit();		
	});	
	
	})
</script>

</html>